﻿using CubicFWNet.Data.Models;
using CubicFWNet.Data.SystemManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Application.SystemManager
{
    public class TakeLogApp
    {
        private readonly TakeLogoRepository _service = new TakeLogoRepository();

        public List<TakeLog> GetListByInventoryId(Guid inventoryId) {
            return _service.IQueryable().Where(c => c.InventoryId == inventoryId).ToList();
        }
        public List<TakeLog> GetListByProductId(Guid productId)
        {
            return _service.IQueryable().Where(c => c.ProductId == productId).ToList();
        }

        public int Add(TakeLog entity) {
            entity.Id = Guid.NewGuid();
            entity.Creation = DateTime.Now;
            return _service.Insert(entity);
        }
    }
}
